package wang.wangby.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

//标识某个方法是接口
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@ResponseBody
@RequestMapping
@Remark
public @interface Api {

	// 访问路径
	@AliasFor(annotation = RequestMapping.class, attribute = "value")
	String path();

	// 接口名称
	@AliasFor(annotation = Remark.class, attribute = "value")
	String name();

	// 允许的方法类型
	@AliasFor(annotation = RequestMapping.class, attribute = "method")
	RequestMethod[] method() default { RequestMethod.GET, RequestMethod.POST };

	//返回内容格式
	@AliasFor(annotation = RequestMapping.class, attribute = "produces")
	String[] produces() default { "application/json;charset=UTF-8" };
	
	//请求的唯一标识字段,用于缓存
	String requestId() default "";

}
